package sqlDao;

import infrastructure.IDossierInfraction;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import services.MyBatisConnectionFactory;
import mappers.DossierInfractionMapper;

public class DossierInfractionDAO implements DossierInfractionMapper{

private SqlSessionFactory sqlSessionFactory; 
	
	public DossierInfractionDAO(){
		sqlSessionFactory = MyBatisConnectionFactory.getSqlSessionFactory();
	}
	
	public void insert(IDossierInfraction dossierInfraction) {
		SqlSession session = sqlSessionFactory.openSession();
        try {
			session.insert("insertDossierInfraction", dossierInfraction);
			session.commit();
		} finally {
			session.close();
		}
	}

}
